import 'dart:developer' as developer;

/// 日志服务 - Logger Service
/// 提供统一的日志记录功能，替代 print 语句
class LoggerService {
  static const String _tag = 'PromptManager';

  /// 调试日志 - Debug log
  static void debug(String message, {String? tag}) {
    developer.log(
      message,
      name: tag ?? _tag,
      level: 500, // Debug level
    );
  }

  /// 信息日志 - Info log
  static void info(String message, {String? tag}) {
    developer.log(
      message,
      name: tag ?? _tag,
      level: 800, // Info level
    );
  }

  /// 警告日志 - Warning log
  static void warning(String message, {String? tag}) {
    developer.log(
      message,
      name: tag ?? _tag,
      level: 900, // Warning level
    );
  }

  /// 错误日志 - Error log
  static void error(String message, {String? tag, Object? error, StackTrace? stackTrace}) {
    developer.log(
      message,
      name: tag ?? _tag,
      level: 1000, // Error level
      error: error,
      stackTrace: stackTrace,
    );
  }

  /// 严重错误日志 - Severe error log
  static void severe(String message, {String? tag, Object? error, StackTrace? stackTrace}) {
    developer.log(
      message,
      name: tag ?? _tag,
      level: 1200, // Severe level
      error: error,
      stackTrace: stackTrace,
    );
  }
}